﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EllenTang.DalFactory
{
    public class DBSessionFactory
    {
        /// <summary>
        /// 静态属性进程中唯一
        /// </summary>
        public static DBSession DbSession { get { return CreateDbSession.dbSession; } }

        /// <summary>
        /// 嵌套类创建实例,当使用DbSession属性时,才调用,否则不会创建实例
        /// </summary>
        class CreateDbSession
        {
            internal static readonly DBSession dbSession = new DBSession();
        }
    }
}
